home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5761 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.9 KB

  1. Path: newshost.lanl.gov!tanmoy
  2. From: tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Easiest way to center a string?
  5. Date: 20 Feb 1996 23:38:29 GMT
  6. Organization: Los Alamos National Laboratory
  7. Distribution: world
  8. Message-ID: <TANMOY.96Feb20163829@qcd.lanl.gov>
  9. References: <4fobka$1st@parlor.hiwaay.net> <DMqEG5.8z4@eskimo.com>
  10.     <4frif5$e6p@fohnix.metronet.com> <DMuuzG.1yK@eskimo.com>
  11.     <4gbmmo$m5v@airdmhor.gen.nz>
  12.     <Pine.A32.3.91.960220105403.86291D-100000@red.weeg.uiowa.edu>
  13. NNTP-Posting-Host: qcd.lanl.gov
  14. Mime-Version: 1.0
  15. Content-Type: text
  16. In-reply-to: The Amorphous Mass's message of Tue, 20 Feb 1996 11:04:40 -0600
  17.  
  18. In article
  19. <Pine.A32.3.91.960220105403.86291D-100000@red.weeg.uiowa.edu> The
  20. Amorphous Mass <robinson@blue.weeg.uiowa.edu> writes: 
  21. <snip>
  22.      That's equivalent to strlen(String + -LineLen), which is in turn 
  23.    equivalent to strlen(String[-LineLen]), and the expression String[-80] is 
  24.    portable only in the sense that its behavior is undefined on all 
  25.    platforms. :)
  26.  
  27. Sorry there is no trigraph for `&': so if that key is broken, you just
  28. have to get it fixed :-)
  29.  
  30.      If you meant (strlen(String) - LineLen) / 2 then you will get a 
  31.    negative length specifier for any string with fewer than LineLen 
  32.    characters.  If you meant (LineLen - strlen(String) / 2, then your 
  33.  
  34. strlen returns size_t which is guaranteed unsigned. (I am assuming
  35. LineLen is not long.)
  36.  
  37. Cheers
  38. Tanmoy
  39. --
  40. tanmoy@qcd.lanl.gov(128.165.23.46) DECNET: BETA::"tanmoy@lanl.gov"(1.218=1242)
  41. Tanmoy Bhattacharya O:T-8(MS B285)LANL,NM87545 H:#9,3000,Trinity Drive,NM87544
  42. Others see <gopher://yaleinfo.yale.edu:7700/00/Internet-People/internet-mail>,
  43. <http://alpha.acast.nova.edu/cgi-bin/inmgq.pl>or<ftp://csd4.csd.uwm.edu/pub/
  44. internetwork-mail-guide>. -- <http://nqcd.lanl.gov/people/tanmoy/tanmoy.html>
  45. fax: 1 (505) 665 3003   voice: 1 (505) 665 4733    [ Home: 1 (505) 662 5596 ]
  46.